UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IMC2QYKr6q0DFuXVuDjlaUYfxJEfqC4KMH2gLA2S/NI='
WHERE
key_id = '5d890a2c68df0353651a6202549e814aac0ffa142e76927fb5480f1af80663b2'
AND (
token = 'IMC2QYKr6q0DFuXVuDjlaUYfxJEfqC4KMH2gLA2S/NI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)