UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PwPvey+mHO7P4veyC6/+B+BkEYIffWFnSIf6Gvv25Jo='
WHERE
key_id = '5df96968ebad85d07aea74f1302eaf3b8c2aec8d41bfcf60d167eda8a316a3b8'
AND (
token = 'PwPvey+mHO7P4veyC6/+B+BkEYIffWFnSIf6Gvv25Jo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)