UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l3W+M6sCF2L4gCQHA7oSmZ9E7rEQBeUab2HjaT9VjGo='
WHERE
key_id = 'd5bd266016fad712ebc5c87ed5e28ac8bca89487cca611e72809b3639862126c'
AND (
token = 'l3W+M6sCF2L4gCQHA7oSmZ9E7rEQBeUab2HjaT9VjGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)