UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'azHV6uVKEb7sShJAcHnYMcazD0N8iiI7MdeARWjvSsk=' 
WHERE 
  key_id = '78a86f71ff8f10e31b52fc4a438ccb745851bcd1f466fce55a53e16fd98e2c72' 
  AND (
    token = 'azHV6uVKEb7sShJAcHnYMcazD0N8iiI7MdeARWjvSsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044