UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ig0Spzt4R2kgcoyjBjb/aHF+lYROR46SlHwTRpty/c4=' 
WHERE 
  key_id = '936b8f8f591b435cfa52ea3644f2503e32059112b562b085dfcb3e4d32baf853' 
  AND (
    token = 'Ig0Spzt4R2kgcoyjBjb/aHF+lYROR46SlHwTRpty/c4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031