UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KrRqtO+2eoZjKQB6yHQIKedqUGfg5Oo4lprq/nFmMJs=' 
WHERE 
  key_id = '893b745f5813bbe71a347912e0780e436cffcffe2ddcf84f2b83b235fefd4e17' 
  AND (
    token = 'KrRqtO+2eoZjKQB6yHQIKedqUGfg5Oo4lprq/nFmMJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045