UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U4KbG/7iX0RsTkvSfNf6cber1hO6CK553kMGtueHSCA='
WHERE
key_id = '44db3e87ada2236501cb2307d8d2c3970a244b2cfe7631220cfcb96c04da9432'
AND (
token = 'U4KbG/7iX0RsTkvSfNf6cber1hO6CK553kMGtueHSCA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)