UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gj3clczEXbDq9oSXxD/puRjGiRVbz4sJhpIUZ230FC0='
WHERE
key_id = '49083bac0009c68172a6cffea2313305d410a79b8171b904dcf889f3e500e439'
AND (
token = 'gj3clczEXbDq9oSXxD/puRjGiRVbz4sJhpIUZ230FC0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)