UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HJv/cbdAB7voENU++F5xtNh27Sr54tgD7b1h9YAtKxo='
WHERE
key_id = '124aec243fec05ee683d547f2c8fa0d619702d4dc6f150959fdfc6df0cd4dae0'
AND (
token = 'HJv/cbdAB7voENU++F5xtNh27Sr54tgD7b1h9YAtKxo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)