UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ANL5bWBlqjZ2yK6X3KxxfgGnrL9WACj97QfzOqWnIJU=' 
WHERE 
  key_id = '6ef705e79d848ab12fffb86488729a1a209aeaf345fb4656f0830de69ee04a9d' 
  AND (
    token = 'ANL5bWBlqjZ2yK6X3KxxfgGnrL9WACj97QfzOqWnIJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033