UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MGmrfmX2Fjxv2llFQ+K1bqC5eYOMjVmN2BCWcorEeDQ=' 
WHERE 
  key_id = '0536ad5ca61e01159972b59b33499de4e0e7457193d447756ffd52438b52fc1c' 
  AND (
    token = 'MGmrfmX2Fjxv2llFQ+K1bqC5eYOMjVmN2BCWcorEeDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017