UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3dtrh5iPqzsWv9CF3wbyh6PmbdGwQD9EDbw7kd94JyA=' 
WHERE 
  key_id = 'ce07bd695035561336af93ae2cfd27988e8ccde6b8d632a8fde24b01743dd8e7' 
  AND (
    token = '3dtrh5iPqzsWv9CF3wbyh6PmbdGwQD9EDbw7kd94JyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037