UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1gb/HX//0APiZMQoLYHSquvUS3iWzBU5P8l3frWts+g='
WHERE
key_id = '5c0becee897c290650b7716cd140ea1de137f0f428bc3331b68b59ee5d745d7a'
AND (
token = '1gb/HX//0APiZMQoLYHSquvUS3iWzBU5P8l3frWts+g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)