UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2PWEg8OUNVhimhgyi3+phyp7ZaD69D2wVSaK0N18Uik='
WHERE
key_id = 'd17e9d83d7f70c2921a5eaa8d52f68d5a74d8faa6798182a069f2fffc6cb6c67'
AND (
token = '2PWEg8OUNVhimhgyi3+phyp7ZaD69D2wVSaK0N18Uik='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)