UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HSWJa3q1g040WBdY7gnfRFHUSSUXsWd/VJOExxx9BJk='
WHERE
key_id = '8cd76eb433e58d9ff2368375d2c35dffd41ff50f792e8d11a020550b44c95a96'
AND (
token = 'HSWJa3q1g040WBdY7gnfRFHUSSUXsWd/VJOExxx9BJk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)