UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wGsFClvPeLzbYG+qjUIVEZT0ru6mVjajkcdmqii3V1w='
WHERE
key_id = '8f3f7763d541f7ef0d11c4bc3869a5dbe22196198c261193e8c0e43dbe281867'
AND (
token = 'wGsFClvPeLzbYG+qjUIVEZT0ru6mVjajkcdmqii3V1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)