UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A+V3rJxY+OaLDi7nCS0QqivDYZJ2M0zHNR9wfDo8zVE=' 
WHERE 
  key_id = 'd2e18f9ac6cefd812ea5383882cc3ac885cc7f2973be88128c9cf51b389ff0a1' 
  AND (
    token = 'A+V3rJxY+OaLDi7nCS0QqivDYZJ2M0zHNR9wfDo8zVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035