UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '82lQCk2qLUP6pnc1p2f+tDuEUhgbwGo6XKhRcZ0LQ0A='
WHERE
key_id = 'd14de90482446d67256ed1d0e1a9240dc0ec59e674aaeb014603ffd08cb2c47f'
AND (
token = '82lQCk2qLUP6pnc1p2f+tDuEUhgbwGo6XKhRcZ0LQ0A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)