UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BKkSK3wjd8Cw/iSWGCW4IYDvkvF707dibZ10EDYdink='
WHERE
key_id = '63b7134e79f576d654e7cc0ca8d1e927e5272a88ac32aafcc6cb27685b7805a1'
AND (
token = 'BKkSK3wjd8Cw/iSWGCW4IYDvkvF707dibZ10EDYdink='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)