UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zkBaa6JSGZ4MQT5AtLO7KcrCU1noc2cCNXv0xIpWh9Q='
WHERE
key_id = '8e76f3d7353007a45f9bac33ea11e23b8201af1544a95a6096cdf7f0e619aa72'
AND (
token = 'zkBaa6JSGZ4MQT5AtLO7KcrCU1noc2cCNXv0xIpWh9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)