UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a+usfwBltt8DgZGaPn+ZRCmJZt+zzDF3YJj14YkWn6w=' 
WHERE 
  key_id = '626242cdcf11a52c43132baa4e577fd95593132b8fa5750e24141f41fd36eea0' 
  AND (
    token = 'a+usfwBltt8DgZGaPn+ZRCmJZt+zzDF3YJj14YkWn6w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042