UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HapE0ciycDAh/CErZYufizfgSnO4d6IAWIapIUMB+Qw='
WHERE
key_id = '48d789025b953141a13f48026856585da25ee42bb3021625c63870226e3ad448'
AND (
token = 'HapE0ciycDAh/CErZYufizfgSnO4d6IAWIapIUMB+Qw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)