UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '90Cc+BBdkAbDHyqwN7+9H43RJOvAQzMV+YWITrhWjeo=' 
WHERE 
  key_id = '681ec114de7770e0e5acd1fd3e27ae5e21453a09b69e73d7206ce5af6e3cdd22' 
  AND (
    token = '90Cc+BBdkAbDHyqwN7+9H43RJOvAQzMV+YWITrhWjeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039