UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7fMVsL0S5kWv8nwPc+JXbTzto6FbRZ3ksSF7qIg1WLw=' 
WHERE 
  key_id = '0f367b60aba418f1d42e2d1a124bbdc81df6d38c88326e563762234af13ed902' 
  AND (
    token = '7fMVsL0S5kWv8nwPc+JXbTzto6FbRZ3ksSF7qIg1WLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00153