UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e0TNNjkLmc2h3VkedRqGJTirbLX58bP+2F8aM/SS7EE=' 
WHERE 
  key_id = 'df2565a6885a65f3550b2fd90640ecc1ab62161cd918ab1064edae46c5941e56' 
  AND (
    token = 'e0TNNjkLmc2h3VkedRqGJTirbLX58bP+2F8aM/SS7EE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047