UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hBaFncyR6erEp3xKkwUupualpd8fuSlBcrvH9xLQX9U='
WHERE
key_id = '3b2bb046edef70d4da0bfdb18949294f90dfc39f539aa57eecd64fa3d7349154'
AND (
token = 'hBaFncyR6erEp3xKkwUupualpd8fuSlBcrvH9xLQX9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)