UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pzTXl9KDJtZgUcqIZKGZ8OTBtV1iY9mGNRCyXyt9hIA='
WHERE
key_id = 'c1e83712c67f0c08bb4db51a6ee98ea0bf153377922c3d10b66586296b9ac009'
AND (
token = 'pzTXl9KDJtZgUcqIZKGZ8OTBtV1iY9mGNRCyXyt9hIA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)