UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NvltxrwyelUC85gaKmVwPO89esFkDM+NVLnS1uHzhKk=' 
WHERE 
  key_id = '468e2d97989413bddc1325fecfa33257e3f9d064c893cba8d71c57c454cac4fa' 
  AND (
    token = 'NvltxrwyelUC85gaKmVwPO89esFkDM+NVLnS1uHzhKk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044