UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jb4fktw0Co8IwMvYkEL44ExFJbK0bQZh5pmzwNItqvc=' 
WHERE 
  key_id = '0f8b4477eeb9a19cbe399ca037d4cb2df0342f687aff309009e758d70c87723a' 
  AND (
    token = 'Jb4fktw0Co8IwMvYkEL44ExFJbK0bQZh5pmzwNItqvc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027