UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WCVrEwnAZNkLi3ZO8yxjcJJOAtofvSu3FHQJ4K2CzOw='
WHERE
key_id = '5de446d6d3c9774ea9e53ca9dbd25796f0da87789b2ac24eae721fafa2043164'
AND (
token = 'WCVrEwnAZNkLi3ZO8yxjcJJOAtofvSu3FHQJ4K2CzOw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)