UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8cVqHIlKY76/YbUs9shSA9V9oDTfcr708OClelEnYjM='
WHERE
key_id = '9a7cac8cecff8a48b0ec45d11190ac46bf584f8285f0f907d66c113252184a8f'
AND (
token = '8cVqHIlKY76/YbUs9shSA9V9oDTfcr708OClelEnYjM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)