UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wqt4IP7PwJd7AYBGnYD3S+IttEDuU5Rau72VH5fkQrM=' 
WHERE 
  key_id = 'c7eceed48f6a933e1161e589332256da36e9a73886148c5b929711da4f0496da' 
  AND (
    token = 'Wqt4IP7PwJd7AYBGnYD3S+IttEDuU5Rau72VH5fkQrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033