UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LVZUjmJqaCG5B8ytIaa8P45m1j8NbPIT1nNITbgKG90='
WHERE
key_id = '37c49c9ce1fb4baeca5c057e62d1104e3bef0d9f80cbced725aceeb9da124c86'
AND (
token = 'LVZUjmJqaCG5B8ytIaa8P45m1j8NbPIT1nNITbgKG90='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)