UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ECGXJhrjFWU/r1C/vApFWT/7r39QaRg4gH606W5Gfoo='
WHERE
key_id = 'db87c56edea68b6caef5065ed1e744f377b0a6fdd32af878c5c1ad1af56615d5'
AND (
token = 'ECGXJhrjFWU/r1C/vApFWT/7r39QaRg4gH606W5Gfoo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)