UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZDg4WRtiHNywYRwGfs5Tv9gisSROVxYNI115tiCtZbk=' 
WHERE 
  key_id = '635c3525db3a126a3a429130df3e9a3c4723ea24ab149383e71b42b689c26bad' 
  AND (
    token = 'ZDg4WRtiHNywYRwGfs5Tv9gisSROVxYNI115tiCtZbk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021