UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y7uIxxN3j8lArgvXZXqouXdPAXmwQy/tpmieE5n0grc=' 
WHERE 
  key_id = '78a9f32b6def732ad433714bcb569de9f60b3f941eb0284946dd8a0a665b724b' 
  AND (
    token = 'y7uIxxN3j8lArgvXZXqouXdPAXmwQy/tpmieE5n0grc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052