UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+IXe3jK9y+6wAZGwzP4QX1RKnnT3HvcWvTaaygWcej4='
WHERE
key_id = 'f9dd2883357cd6e848093c03c4a7d5330da4aa313f3d3419c4de840e6624534e'
AND (
token = '+IXe3jK9y+6wAZGwzP4QX1RKnnT3HvcWvTaaygWcej4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)