UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9aEXIfXXQKfsTQWsr4rjpuETM6tHVRmbzUQ8wg1rTLY='
WHERE
key_id = 'ee37991caa0154361b42e94b960512a85f7f2a0a474d453f620e9ef737a115d3'
AND (
token = '9aEXIfXXQKfsTQWsr4rjpuETM6tHVRmbzUQ8wg1rTLY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)