UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1oGtq72/vLtjpJgv1g2Bt4IaIMyCQmNEuhLSLgCUt6k='
WHERE
key_id = '0d93f9f36862c0b908779291d1b5a29dccd1924c0ecb58452c3934eaa47af7c0'
AND (
token = '1oGtq72/vLtjpJgv1g2Bt4IaIMyCQmNEuhLSLgCUt6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)