UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p2MWJM6znHb3S+tpiAbIyO+N1cyycLnZW6wDbmfX/QA=' 
WHERE 
  key_id = '2042c672d321d3f5b42bbd8e8b6280c9f038a4730f43bdbf67f9e43ed1177b66' 
  AND (
    token = 'p2MWJM6znHb3S+tpiAbIyO+N1cyycLnZW6wDbmfX/QA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032