UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e6Jswp80fCAjVZnWkqfKxruCzerNLe6d5kxlVrwcec0=' 
WHERE 
  key_id = 'fa6740840eec1afa02fa78b9542b34d959f600a64220fa1bc0d6426dc70fd315' 
  AND (
    token = 'e6Jswp80fCAjVZnWkqfKxruCzerNLe6d5kxlVrwcec0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034