UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VWZPKBEta5Pcb1utinbEmOBtMiyhBEqRuDg/KsLuJM0=' 
WHERE 
  key_id = '49431a36e609fddc23b960ae871bf2146a72f559cf251197d9c3a115149387b4' 
  AND (
    token = 'VWZPKBEta5Pcb1utinbEmOBtMiyhBEqRuDg/KsLuJM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030