UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SUtd2V+XcL0EgLkawqPHi0UUyqGHCvv/5A/slodCuhw='
WHERE
key_id = '0a9864eb9c0bf2e85c8016221bc3628d5d4113b4eacd1a4beaffe45b015b3a94'
AND (
token = 'SUtd2V+XcL0EgLkawqPHi0UUyqGHCvv/5A/slodCuhw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)