UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b+1Fyft69Kif6/5wGAyy8fbnCiWHuzfLmjlaTySXVS4='
WHERE
key_id = '357b85f6a32d6d0f981d1dca1d2228de4f0fb9ad48ef95a775b457b1fca72d70'
AND (
token = 'b+1Fyft69Kif6/5wGAyy8fbnCiWHuzfLmjlaTySXVS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)