UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JqAntL6uU4EasxuYz//SfeyIHCvfxKSQwfulXqSCDNU=' 
WHERE 
  key_id = 'bb42f2ea4e9844b10c7f2ac90a3ecdc0381e09e38ef1e061bb1da2f51b89e7e7' 
  AND (
    token = 'JqAntL6uU4EasxuYz//SfeyIHCvfxKSQwfulXqSCDNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050