UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qckBVpgBhGjh1/dMUFnOSaC+QbmRbDKIT1B+18aRyYA='
WHERE
key_id = '34ba9ed191571ca75c7bf2b1a9be4e4e3b3bc5cf9da7fb4f730d1c5471f937e6'
AND (
token = 'qckBVpgBhGjh1/dMUFnOSaC+QbmRbDKIT1B+18aRyYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)