UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7bVPwG24eKbisn0ob2Om29jAxDIhif7sH++a7c5BHLY=' 
WHERE 
  key_id = '5a1fb544d19937d9bf6d385166bdbe6ef9e27932c0a61669a71ace63777bcb73' 
  AND (
    token = '7bVPwG24eKbisn0ob2Om29jAxDIhif7sH++a7c5BHLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054