UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ASvBvST6SAUKj0v19ksGQARVbHnnJGC/4VqLt3Xryoc=' 
WHERE 
  key_id = 'e99289dedce651048e7d15155dff6935e29594b045964dd0ca2af6b8ef5b0b73' 
  AND (
    token = 'ASvBvST6SAUKj0v19ksGQARVbHnnJGC/4VqLt3Xryoc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028