UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6I7WLG0iREubooPbTWr45pOxSscOJIiCwsoK4i5S+bI='
WHERE
key_id = '453f6b05245ae811d53148dc0af58f0c51bbd6974af481ac812abfb40a199e1b'
AND (
token = '6I7WLG0iREubooPbTWr45pOxSscOJIiCwsoK4i5S+bI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)