UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bG1szKvDxJt2Rvu7kj8S7B7U+LP7mo14xfBYpD32N9E=' 
WHERE 
  key_id = 'e28efa06ed2c4ab1c21b66f44a61a9396c729ea60a86830bee1d6428cac509d3' 
  AND (
    token = 'bG1szKvDxJt2Rvu7kj8S7B7U+LP7mo14xfBYpD32N9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034